/*
 * ui.cpp
 *
 *  Created on: 2012-10-12
 *      Author: yangentao@gmail.com
 */

#include "ui.h"

#include <CommCtrl.h>

#include "SoyWindowClass.h"
#include "Window.h"

void initControls();

void InitUI() {
	initControls();
	addWindowCreateHook();
	initConfig();
	registerSoyWindowClass();
}
void CleanUI() {
	removeWindowCreateHook();
	Canvas::clearCache();
	cleanConfig();
	unregisterSoyWindowClass();
}

void initControls() {
	INITCOMMONCONTROLSEX init;
	init.dwSize = sizeof(init);
	init.dwICC = ICC_STANDARD_CLASSES;
	init.dwICC |= ICC_ANIMATE_CLASS | ICC_BAR_CLASSES | ICC_COOL_CLASSES | ICC_DATE_CLASSES | ICC_HOTKEY_CLASS;
	init.dwICC |= ICC_INTERNET_CLASSES | ICC_LINK_CLASS | ICC_LISTVIEW_CLASSES | ICC_NATIVEFNTCTL_CLASS;
	init.dwICC |= ICC_PAGESCROLLER_CLASS | ICC_PROGRESS_CLASS | ICC_TAB_CLASSES;
	init.dwICC |= ICC_TREEVIEW_CLASSES | ICC_UPDOWN_CLASS | ICC_USEREX_CLASSES;
	InitCommonControlsEx(&init);
}
